import torch

x = torch.ones(5)
y = torch.zeros(3)
w = torch.randn(5,3,requires_grad=True)
b = torch.randn(3,requires_grad=True)
z = torch.matmul(x,w) + b
print(z.shape)
print(y.shape)
loss = torch.nn.functional.binary_cross_entropy_with_logits(z,y)
#
loss.backward()
print(loss.grad_fn)
print(z.grad_fn)
print(w.grad)
print(b.grad)